var app = angular.module('pwcDemo', []);

app.controller('headerController', [ '$scope', '$http', function($scope, $http) {
    $scope.headStyle="static";

    $scope.color={"pwc_red":"#990000","pwc_orange_red":"#CC6600","blue":"#000099"};
    $scope.headColor="pwc_red";

    $scope.changeHeadStyle=function(value)
    {
        $scope.headStyle=value;

        $("#divided-header").html("");
        if($scope.headStyle=='fixed'){
            $("#nav").show();
            $("#nav").css("position","fixed");
            $(".main-section").css("padding-top","6.5em");
        }else if($scope.headStyle=='static'){
            $("#nav").show();
            $("#nav").css("position","static");
            $(".main-section").css("padding-top","3em");
        }else if($scope.headStyle=='divided')
        {
            $("#nav").hide();
            $("#divided-header").load("/static/html/nav.html",function(){
                $(this).find("#navbar").show();
                $(this).find(".nav-title").hide();
                $(this).prepend("<img src='/static/image/logo-pwc.png' width='200px'/>");

                $scope.changeHeadColor($scope.headColor);
            });

        }

    }


    $scope.changeHeadColor=function(value)
    {
        $scope.headColor=value;

         $("nav").css("background-color",$scope.color[$scope.headColor]);

    }

} ]);